<template>
	<view class="scroll-view-wrap">
		<view class="top-fixed">
			<slot name="topFixed"></slot>
		</view>
		<scroll-view scroll-y class="content" :style="{ height: zscrollViewHeight }" >
			<slot name="content"></slot>
		</scroll-view>
	</view>
</template>
<!-- 
<scroll-view-wrap>
	<template #topFixed></template>
	<template #content></template>
</scroll-view-wrap>
 -->
<script>
	export default {
		inheritAttrs: false,
		props: {},
		computed: {
			customizedAttrs() {
				return {
					// 支持传过来的size覆盖默认的size
					...this.$attrs
				};
			}
		},

		data() {
			return {
				scrollViewHeight: 0,
				zscrollViewHeight: ""
			};
		},

		mounted() {
			this.start();
		},
		methods: {
			start() {

				let res = uni.getSystemInfoSync();
				let window_height = res.windowHeight; //windoHeight为窗口高度，主要使用的是这个
				this.scrollViewHeight = window_height - 65;
				this.zscrollViewHeight = this.scrollViewHeight + "px";
			}
		}
	};
</script>

<style scoped lang="less">
	.scroll-view-wrap {
		
	}

	.top-fixed {}
</style>